import java.util.Arrays;
import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25228
 * Date: 2024-10-15
 * Time: 9:53
 */
public class Test {
    public static void main(String[] args) {
        int[] array=new int[10];
        Random random=new Random();
        Arrays.fill(array,2);
        for (int i = 0; i < 10; i++) {
            array[i]=array[i]+random.nextInt(100);
        }
        Arrays.sort(array);
        System.out.println(Arrays.toString(array));
        int val=array[4];
        System.out.println(val);
        int s=Arrays.binarySearch(array,val);
        System.out.println(s);
    }
}
